{include file='header.html'}

<ul class="nav nav-tabs">
<li><a href="{$appadmin}?m=sites">{$lang.sites_admin}</a></li> 
</ul>

<form method="post" action="{$appadmin}?m=sites&a=save">
<input type="hidden" name="siteid" value="{$data.siteid}" />
<table width="100%" border="0" class="table table-bordered">
  <tr>
    <td width="17%" align="right">{$lang.sitename}：</td>
    <td width="83%"><input name="sitename" type="text" id="sitename" value="{$data.sitename}" /></td>
  </tr>
  <tr>
  	<td>所在地区</td>
    <td>
    {get data=tc model=options fun=children(0,"sitearea",1)}
    	<select name="cityid">
    		<option value="0">请选择</option>
            {foreach item=c from=$tc}
            <option value="{$c.id}" {if $c.id eq $data.cityid} selected{/if}>{$c.title}</option>
            {if $c.child}
            {foreach item=cc from=$c.child}
            <option value="{$cc.id}" {if $cc.id eq $data.cityid} selected{/if}>|--{$cc.title}</option>
            {/foreach}
            {/if}
            {/foreach}
    	</select>
    </td>
  </tr>
  <tr>
    <td align="right">{$lang.domain}：</td>
    <td><input name="domain" type="text" id="domain" value="{$data.domain}" /></td>
  </tr>
 
  <tr>
  	<td>logo：</td>
    <td><div id="up1" url="/index.php?m=upload&a=uploadtao&dir=site&id={$data.id}">
    	<div class="btn-upload">
          <input type="file" name="upimg" id="ud"  class="btn-upload-file" onChange="uploadimg('up1')">
         </div>
 
          <input type="hidden" name="logo" class="imgurl" value="{$data.logo}">
          <span class="imgShow">
          {if $data.logo}
          <img src="{$data.logo|images_site}.100x100.jpg">
          {/if}
          </span>
      </div></td>
  </tr>
  <tr>
    <td align="right">{$lang.title}：</td>
    <td><input name="title" type="text" id="title" value="{$data.title}" class="w600" /></td>
  </tr>
  <tr>
    <td align="right">{$lang.keywords}：</td>
    <td><input name="keywords" type="text" id="keywords" value="{$data.keywords}" class="w600" /></td>
  </tr>
  <tr>
    <td align="right">{$lang.description}：</td>
    <td><textarea name="description" id="description" cols="45" rows="5">{$data.description}</textarea></td>
  </tr>
  
  <tr>
    <td align="right">{$lang.is_open}：</td>
    <td><input type="radio" name="is_open" id="radio" value="1" {if $data.is_open eq 1} checked="checked"{/if} />
      {$lang.open}
        <input type="radio" name="is_open" id="radio2" value="2" {if $data.is_open eq 2} checked="checked"{/if} />
      {$lang.close}</td>
  </tr>
  
  <tr>
    <td align="right">{$lang.icp}：</td>
    <td><input name="icp" type="text" id="icp" value="{$data.icp}" /></td>
  </tr>
  <tr>
    <td align="right">{$lang.index_template}：</td>
    <td><input name="index_template" type="text" id="template" value="{$data.index_template}" size="40" /></td>
  </tr>
  <tr>
    <td align="right">{$lang.statjs}：</td>
    <td><textarea name="statjs" cols="45" rows="5" id="statjs">{$data.statjs}</textarea></td>
  </tr>
  <tr>
  	<td>Gps</td>
    <td>
    地图搜索：<input type="text" name="word" id="word" /> <br>
    <div id="map_canvas" style="width:600px; height:300px;"></div>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak={const.BDMAPKEY}"></script>
    <script language="javascript">
	function NoSubmit(ev)
	{
		if( ev.keyCode == 13 )
		{
			return false;
		}
		return true;
	}
	$("#word").bind("keyup",function(){
			localsearch($(this).val());
		});
   var map = new BMap.Map("map_canvas");
   map.enableScrollWheelZoom();
   var point = new BMap.Point({if $data.lat>0}{$data.lng},{$data.lat}{else}118.165810,24.485228{/if});
   map.centerAndZoom(point, 12);
   var marker = new BMap.Marker(point);  // 创建标注
	map.addOverlay(marker);              // 将标注添加到地图中
	marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
   map.addEventListener("click", function(e){
	   map.removeOverlay(marker);
	   point = new BMap.Point(e.point.lng,e.point.lat);
	   marker = new BMap.Marker(point);  // 创建标注
	   
		map.addOverlay(marker);  
	   $("#lat").val(e.point.lat);
	   $("#lng").val(e.point.lng);
   });
   
   function localsearch(word){
	   var local = new BMap.LocalSearch(map, {
		  renderOptions:{map: map}
		});
		local.search(word);
   }
    </script></td>
  </tr>
   <tr>
          <td>纬度：</td>
          <td><input type='text' name='lat' id='lat' value='{$data.lat}' ></td>
        </tr>
        <tr>
          <td>精度：</td>
          <td><input type='text' name='lng' id='lng' value='{$data.lng}' ></td>
        </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交" class="btn" /></td>
  </tr>
</table>

</form>
<script language="javascript" src="/plugin/jquery/ajaxfileupload.js"></script>
<script language="javascript" src="/static/js/upload.js"></script>
{include file='footer.html'}